using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.CompositeUI.SmartParts;
using System.Drawing;
using Microsoft.Practices.CompositeUI.Utility;

namespace SCSFContrib.CompositeUI.WinForms.SmartPartInfos
{
    /// <summary>
    /// A <see cref="SmartPartInfo"/> that describes how a smartpart will be shown in a dock workspace.
    /// </summary>
    public class DockPanelSmartPartInfo : IconSmartPartInfo
    {
        private DockingType dockingType;
        private IShowStrategy showStrategy = new DefaultShowStrategy();

        public DockingType DockingType
        {
            get { return dockingType; }
            set { dockingType = value; }
        }

        public IShowStrategy ShowStrategy
        {
            get { return showStrategy; }
            set { showStrategy = value; }
        }

        public DockPanelSmartPartInfo() : base() { }

        public DockPanelSmartPartInfo(string title, string description) : base(title, description) { }

        /// <summary>
        /// Creates a new instance of the DockPanelSmartPartInfo and copies over the information 
        /// in the source smart part.
        /// </summary>
        public static DockPanelSmartPartInfo ConvertTo(ISmartPartInfo source)
        {
            Guard.ArgumentNotNull(source, "source");

            DockPanelSmartPartInfo info = new DockPanelSmartPartInfo(source.Title, source.Description);
            
            IconSmartPartInfo iconInfo = source as IconSmartPartInfo;
            if (iconInfo != null) { info.Icon = iconInfo.Icon; }

            return info;
        }
    }

    public enum DockingType
    {
        Document,
        TaskView
    }
}
